import {
  Progress,
  DataSet,
} from 'choerodon-ui/pro';
import React, {useMemo} from 'react';
import {ProgressType, ProgressStatus} from 'choerodon-ui/lib/progress/enum';
import { Size } from 'choerodon-ui/lib/_util/enum';
import DateDS from './progressDataSet';

type Format = (((percent: number) => string) & string) | undefined

// @ts-ignore
const format:Format = ():string => {
  return 'Done';
};

const progressLine: React.FC = ():React.ReactElement => {

  const timeDs:DataSet = useMemo(() => new DataSet(DateDS()), []);

  return (
    <>
      <Progress dataSet={timeDs} name="percent" value={75} type={ProgressType.line} size={Size.small} />
      <Progress value={100} type={ProgressType.line} format={format} status={ProgressStatus.success} />
      <Progress value={35} type={ProgressType.line} status={ProgressStatus.exception} size={Size.large} />
    </>
  );
};

export default progressLine;